// LSL script generated: RLV-New.PARTS.#Attachment-Addon.lslp Sun May  2 09:50:59 Westeuropäische Sommerzeit 2010

string ANIM = "express_open_mouth";
string gsCardName = "Owner";
list glCardRows;
key gkQuery;
integer giLine = 0;
integer playTrigger = 0;
default {

    state_entry() {
        (glCardRows = []);
        (giLine = 0);
        (gkQuery = llGetNotecardLine(gsCardName,giLine));
    }

    
    link_message(integer sender,integer num,string str,key id) {
        if ((num == 1437)) {
            if ((str == "playAnimation")) {
                (playTrigger = 1);
            }
            else  if ((str == "stopAnimation")) {
                (playTrigger = 0);
            }
        }
    }

  	
  	timer() {
        if ((playTrigger == 1)) {
            llStartAnimation(ANIM);
        }
    }

	
	attach(key attached) {
        if ((attached != NULL_KEY)) {
            llRequestPermissions(attached,16);
        }
        else  {
            llSetTimerEvent(0.1);
        }
    }


    run_time_permissions(integer perms) {
        if ((perms & 16)) {
            llSetTimerEvent(0.1);
        }
    }

	dataserver(key _query_id,string _data) {
        if ((_query_id == gkQuery)) {
            if ((_data == EOF)) {
            }
            else  {
                llMessageLinked(-4,1438,_data,NULL_KEY);
                (++giLine);
                (gkQuery = llGetNotecardLine(gsCardName,giLine));
            }
        }
    }
}
